<template>
	<view class="layui-form-item">
		<label class="layui-form-label" v-if="title">{{title}}</label>
		<view class="layui-input-block" :style="{'margin-left':title?'140px' :'0'}">
			<textarea :maxlength="maxlength" @blur="blur" @input="input" :auto-height="autoHeight" :name="name" :value="value" :disabled="disabled" :placeholder="placeholder" autocomplete="off" class="layui-textarea" :class="{'disabled':disabled}"></textarea>
		</view>
	</view>
</template>

<script>
	export default {
		name : "textareaGroup" ,
		props:{
			title : {
				default : ""
			},
			name : {
				default : ""
			},
			value : {
				default : ""
			},
			placeholder : {
				default : ""
			},
			disabled : {
				default : false
			},
			maxlength:{
				default : 200
			},
			autoHeight : {
				default : true 
			}
		},
		created() {
			if (!this.value) {
				this.value = "" ;
			}
		},
		watch:{
			value : function(e){
				if (!this.value) {
					this.value = "" ;
				}
			},
		},
		data() {
			return {
				
			}
		},
		methods: {
			input:function(e){
				this.$emit("input" , e);
			},
			blur:function(e){
				this.$emit("blur" , e);
			},
		}
	}
</script>

<style>
.layui-input.disabled{
	background-color: #f1f1f1;
}
</style>
